UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm7rwnvTGvvd+19KN0GU8SVXzUCThxBIjeo+j8T19khY=' 
WHERE 
  key_id = '3ec0020d34b6fdadb0f963a238dc0ec7509762eb6396b2d8104c8baa1a73977c' 
  AND (
    token = 'm7rwnvTGvvd+19KN0GU8SVXzUCThxBIjeo+j8T19khY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037