UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n9iSp0gR/5PJx5g4skKiiyoUIuTLKNHyPPyywnZNbfA=' 
WHERE 
  key_id = '0812da798e45bf94f0535407529694f84022bb1bb7da27418aada6ca04fadac7' 
  AND (
    token = 'n9iSp0gR/5PJx5g4skKiiyoUIuTLKNHyPPyywnZNbfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047