UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mrdNk1bU34XPcc488IJER4Ew6ZcwvGbrsThK8/OqIpU='
WHERE
key_id = 'f3acc1e0a5cefffe77dde2142f5c85a595d949eca1f6cf474422bdc533d735db'
AND (
token = 'mrdNk1bU34XPcc488IJER4Ew6ZcwvGbrsThK8/OqIpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)