UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VudsnzmxFU1cQvqp7wB5hvoWb4LM4nMrtIEGtltECJY=' 
WHERE 
  key_id = '7c2a4faaadb79de147a8d8e2a121740113f4f6bcd2259c7db445e505389e8572' 
  AND (
    token = 'VudsnzmxFU1cQvqp7wB5hvoWb4LM4nMrtIEGtltECJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050