UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fQ65Vpt+28JXCuMQNxeun2s3POR6/0D1BGwl9Akf/rg='
WHERE
key_id = 'e1461834d1637a0133611c7f0a1442f6c5e39883d4afb67a04b71e85ec231027'
AND (
token = 'fQ65Vpt+28JXCuMQNxeun2s3POR6/0D1BGwl9Akf/rg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)