UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gzWOpsXHhU6tw8s85C7j64y5N26pb3CxB+n+CwVyHfE='
WHERE
key_id = 'bc3926579cd10e12755035205b1959b326df458d0867ee47cb648089d1001a70'
AND (
token = 'gzWOpsXHhU6tw8s85C7j64y5N26pb3CxB+n+CwVyHfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)