UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nDkesFimjnvSTRjPtqi7dzV6gcjbLRL3ga8Jl5+z7KM='
WHERE
key_id = 'e908bac563c5e3cbd51d04b81971f76eaf790e65f1ddef1cc8e2abcfa171da1e'
AND (
token = 'nDkesFimjnvSTRjPtqi7dzV6gcjbLRL3ga8Jl5+z7KM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)