UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mhRojMPj7lAtigA2h+KEQLNKyS0aYw7batD7qCQruM='
WHERE
key_id = '5e2b54e095655e25ecbfe01552f1d0df8a244dae8e053594e37bb06668b1e72b'
AND (
token = '1mhRojMPj7lAtigA2h+KEQLNKyS0aYw7batD7qCQruM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)