UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N7vnooryShPLH+bPAbYRXOUG5JhEvMbp8OeLOYIfo/Q='
WHERE
key_id = '664c859b10a02147a1bccc6cb881b4c388b38e385cbedc12d5071e9d71c21c14'
AND (
token = 'N7vnooryShPLH+bPAbYRXOUG5JhEvMbp8OeLOYIfo/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)