UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YcFcIOmYQsHLTWpIl7u9Ru0p4XGUVGM5tk4Y76i9TWA='
WHERE
key_id = 'c2c4c05664cc30c80063f00af1ad05a43a6735ccf34c0b2d800ed307bd4ab30c'
AND (
token = 'YcFcIOmYQsHLTWpIl7u9Ru0p4XGUVGM5tk4Y76i9TWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)