UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iO3Qpyh6U9wkDrAJikfELl6n5QrFDjUF3/ZkVZsdso0='
WHERE
key_id = 'ce1fb69095e52647433d06aeb6ee4338316e3ea33d0b57a50566137031ddb1e5'
AND (
token = 'iO3Qpyh6U9wkDrAJikfELl6n5QrFDjUF3/ZkVZsdso0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)