UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbTqVUz+M2jyTQXmmxVSQfpXHkPOBiDnHJlZlCokyGY=' 
WHERE 
  key_id = 'cc83829bdba12db9a7d940c388b8f7fe7e9417b967eee663a5d856a7457c5079' 
  AND (
    token = 'cbTqVUz+M2jyTQXmmxVSQfpXHkPOBiDnHJlZlCokyGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038