UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ldhAapWInmUOP3D0JBEU1ftWmx0rF0LGcnsa+XJ910='
WHERE
key_id = '4b8aaf1006fa292034074ef2eef7e26ef74a048d82ecd64e38d6edd6ddd88f8c'
AND (
token = '9ldhAapWInmUOP3D0JBEU1ftWmx0rF0LGcnsa+XJ910='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)