UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zo/F73aq4a9Cx2U3fYb/mxVTnfmVIwQOBzq5wqUWENE='
WHERE
key_id = '1a9aa15fe86dd86e4d46b3da5a21b3002e747f1fdd54f8526e14abd1e13e8c79'
AND (
token = 'Zo/F73aq4a9Cx2U3fYb/mxVTnfmVIwQOBzq5wqUWENE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)