UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIfShq1o/DB5Rf9I3AeI+HhJWxqxl03Oi1CAFwPYZmY='
WHERE
key_id = 'e489e3e13ca0f590d46e252fcb3de007e9ad648355f3e77c331c02437209c3a0'
AND (
token = 'kIfShq1o/DB5Rf9I3AeI+HhJWxqxl03Oi1CAFwPYZmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)