UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WiGp+StVuvj3q/o2hyOMmsGNcOhHPMHNNuN/+ODsbGk='
WHERE
key_id = 'c84d04618507cff2a2e512d1be0304388db2904b546d370548517f75d9af109f'
AND (
token = 'WiGp+StVuvj3q/o2hyOMmsGNcOhHPMHNNuN/+ODsbGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)