UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Qb67LGL6ZVV30/NlAk1xja8d6CgJWOM6Vd7+k3dD+k=' 
WHERE 
  key_id = '92223457415ed4d1345545d28f1c1efeae0fa094873c773b0580b3dbe36758b0' 
  AND (
    token = '+Qb67LGL6ZVV30/NlAk1xja8d6CgJWOM6Vd7+k3dD+k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018