UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fqIKetEoufpIBCvim7Kc2YJHj0lmEYeXaTGw7i10MGc='
WHERE
key_id = 'de3c0d1c0ed15c44cc9c87ea5395521a8c1c085f059a88d10b702119ff316d3b'
AND (
token = 'fqIKetEoufpIBCvim7Kc2YJHj0lmEYeXaTGw7i10MGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)