UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bk6cefc1B/Zn+RiMpHFjsA0Q9AbJ0koFU/VgEdbePD4='
WHERE
key_id = '5be6cb75db7c40052072a11982340863956612954bbee2bf84d87647dbe37a53'
AND (
token = 'Bk6cefc1B/Zn+RiMpHFjsA0Q9AbJ0koFU/VgEdbePD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)