UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kXimVX/TBg3DybdhIvss0rmW12A+At9/Tf3fQok2SPk=' 
WHERE 
  key_id = 'cb28909d83c70b099027a707d83671625c6767ec8cede651f695de4c43e78836' 
  AND (
    token = 'kXimVX/TBg3DybdhIvss0rmW12A+At9/Tf3fQok2SPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057