UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tlmbJFu/p1iLwawNnt2dufhaT+0ovVM6Z51PDxRtTl4='
WHERE
key_id = 'fc3d3ce50bfa69297e3f6a74e4bfd21f51b4583d48e0c366dc54a03c5d9b8fb6'
AND (
token = 'tlmbJFu/p1iLwawNnt2dufhaT+0ovVM6Z51PDxRtTl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)