UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBsLuvRdTBONEIIxGLMl7cwoJU2F8iimPQ5B0TUX4fQ=' 
WHERE 
  key_id = '0cc60eb4a1ecea26904252a111b3b232298094eaaf74c69ccbc2e51c346ff41a' 
  AND (
    token = 'lBsLuvRdTBONEIIxGLMl7cwoJU2F8iimPQ5B0TUX4fQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056