UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lwure80SZwuw/ABjLc0CH4A/mU6zJhmURi7bALJ6eOI='
WHERE
key_id = '9450e01c0898ff59e8a65750182226393be138a2fdbaac57ae5cb69e49dd99b8'
AND (
token = 'Lwure80SZwuw/ABjLc0CH4A/mU6zJhmURi7bALJ6eOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)