UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6J7NpFC/A5Di+4+7A914xuzHuxc+Cnb9TtLk6u+8mpI=' 
WHERE 
  key_id = 'ea7dd2b8b9d7fe8a57798e62d163be610ec0b7e8f21f1809b9c56652dfbca7d9' 
  AND (
    token = '6J7NpFC/A5Di+4+7A914xuzHuxc+Cnb9TtLk6u+8mpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030