UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hA8RIPe9dgWCu996ZHIIxTp1toATjlJXC48Huc2Lj1c='
WHERE
key_id = '803cf10accf68bfc1a121e33f2aeb1e6f2880b5d96f67b5a7422d2e9fc9060aa'
AND (
token = 'hA8RIPe9dgWCu996ZHIIxTp1toATjlJXC48Huc2Lj1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)