UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4NdbUFdBGLs9TUVtIlHxq8kqQwRLofExtIrPdGw2/R4=' 
WHERE 
  key_id = '9e82162e18ed067911446b2d718f221df6884ac8ff38055662a8388c2da90ce5' 
  AND (
    token = '4NdbUFdBGLs9TUVtIlHxq8kqQwRLofExtIrPdGw2/R4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057