UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jjkiaau7kGjXAVqH+S4akOyNEKVZpPDGFEAMT8JdzbA='
WHERE
key_id = 'c65fb2036cc910a2347da0a3f1727dfcde0d2e3498fc9b23a625e75b5984e002'
AND (
token = 'Jjkiaau7kGjXAVqH+S4akOyNEKVZpPDGFEAMT8JdzbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)