UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v0Asqlwbc5m371uSeo2VGmsl/IxyQhYeN5ho1QKlP0c='
WHERE
key_id = 'c4b90048924d42079ac5d2d5f6e6b0528e7d48780b22a8fedc44b473ad3b0621'
AND (
token = 'v0Asqlwbc5m371uSeo2VGmsl/IxyQhYeN5ho1QKlP0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)