UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CcORGtTMi8uZU9sfJmAIM3aGtLh0HZ8TKaxlnR05eiM='
WHERE
key_id = '6a2da0ee19afed70c84e7acf5cda06d9a43c2670d8b7a594abb6278fbc358a42'
AND (
token = 'CcORGtTMi8uZU9sfJmAIM3aGtLh0HZ8TKaxlnR05eiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)