UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UdIF/+9olBWp9gGaGPrQLYc2IOYsq34qESnzkz3an2A='
WHERE
key_id = 'b30a5a22ccaa1c87c2b3f6d02c5f6b44f144ff38a3241da98ce0925baebdf8c2'
AND (
token = 'UdIF/+9olBWp9gGaGPrQLYc2IOYsq34qESnzkz3an2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)