UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Lt54aA5D94rX5zAeLV6hDgZi2oFzTMYZSuj2LsN0Mc=' 
WHERE 
  key_id = '7f7476c140e68f89fb15ec6d0581c8cf7a8ec96e4baaa49b378a9ddbb0264f32' 
  AND (
    token = '3Lt54aA5D94rX5zAeLV6hDgZi2oFzTMYZSuj2LsN0Mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044