UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f+hyHMHnjr8ey9pjy6Yk3VWDaD7Oww2rQFqVbP2fAHk='
WHERE
key_id = 'c0b000dcff14cb2d4bebaf7161b4f2b855fca1f80ac0c5e21535b856ce8c45f1'
AND (
token = 'f+hyHMHnjr8ey9pjy6Yk3VWDaD7Oww2rQFqVbP2fAHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)