UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LAFDMO0Cquf0j+aVjT8zNli7bSwvt0AXg7bSqydFDvs='
WHERE
key_id = 'cd6bac0f91c74731cd27a1420049bd51a4694843fc2f0fdbae26c9ab89bef7d9'
AND (
token = 'LAFDMO0Cquf0j+aVjT8zNli7bSwvt0AXg7bSqydFDvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)