UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'REYVzm+xBbJRvUeeItQoo2ez/XMdERejCRGNlxLsCK4=' 
WHERE 
  key_id = 'cd937a1d84f536947311bbb9b8256267d39e36004d5ef0eb08d1778637ac2abf' 
  AND (
    token = 'REYVzm+xBbJRvUeeItQoo2ez/XMdERejCRGNlxLsCK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052