UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1PldhESX75eakXWgTHDhpAqCIddwCBnVGnu8iTQ8I0c='
WHERE
key_id = 'aba0b198f3d55d20fc0fdb5a9b5cd87189256714dde1dbb89c7a44ea46faed5a'
AND (
token = '1PldhESX75eakXWgTHDhpAqCIddwCBnVGnu8iTQ8I0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)