UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QcbDazMPFQiwtxoxK59P8xjDi+7ZmfD++66yFmT4TzU='
WHERE
key_id = '286855687b4fd662cb17870e74c05710080fbf0dcf896d3b59393c489ed28009'
AND (
token = 'QcbDazMPFQiwtxoxK59P8xjDi+7ZmfD++66yFmT4TzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)