UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTnOGKgH6PyzLV8UFpZkNoORw14GB7BNtpFfFgxZQOs='
WHERE
key_id = '18515fb450505a88f6a957fa3ca1954cc3ca23caa30139d49bc707a01c8cf256'
AND (
token = 'wTnOGKgH6PyzLV8UFpZkNoORw14GB7BNtpFfFgxZQOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)