UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tGTwFtPC7nGLHFhKVcTbFG7RfxnWrXZsjTALafdHwjM=' 
WHERE 
  key_id = '167f548663ae773c46036588a6216c44da40e2de587874d6da690b1a38826e73' 
  AND (
    token = 'tGTwFtPC7nGLHFhKVcTbFG7RfxnWrXZsjTALafdHwjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047