UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6mXqxIOQqNLNLEKUAI5gZWeY8wf/tzJ6uFVpqlGK0Ko=' 
WHERE 
  key_id = 'cacd073835d8b1c1ff7201307e7f731f7ba8e49467bc811e84690a475bb1a878' 
  AND (
    token = '6mXqxIOQqNLNLEKUAI5gZWeY8wf/tzJ6uFVpqlGK0Ko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033