UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DdevpuatOxk3N/Hw5BEmdVeaf7WZ/plRLReGiYZBSyo='
WHERE
key_id = 'f6dae8774827b9e9fbe3b75eb4461d259ad9ca562b141d2e14dd69a2f032dd5e'
AND (
token = 'DdevpuatOxk3N/Hw5BEmdVeaf7WZ/plRLReGiYZBSyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)