UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OdIQuamjjCBPinZ/o3+Vu2SwrKNWOER2gbTHpfN2sC8='
WHERE
key_id = '16971189c2bb47ebd1301b6324bf5578c32c9195194eea9699fdfe2c0afef6a6'
AND (
token = 'OdIQuamjjCBPinZ/o3+Vu2SwrKNWOER2gbTHpfN2sC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)