UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qedlDsCYIcMAdI9udGhTOLyGSWt5OTX7g8JYSS9yr5Q=' 
WHERE 
  key_id = '92767957945e804e35ed9eeadcc32e2a68e9eeddfb0ce44c4e45803af5bc5a5f' 
  AND (
    token = 'qedlDsCYIcMAdI9udGhTOLyGSWt5OTX7g8JYSS9yr5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025