UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GlEY0bcGe2QeDoVmiDwwc7+URmYRF9PNou3jRQXrYGw=' 
WHERE 
  key_id = '154b9097699ffc2e36068c75169d1deeb16d2bfadd788db276ae63930beae873' 
  AND (
    token = 'GlEY0bcGe2QeDoVmiDwwc7+URmYRF9PNou3jRQXrYGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037