UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVjD3pIAAHj8t1R0Kkj/6N3WqUu7MFaiTrk5kjJz1kk='
WHERE
key_id = 'b58c2d16bdf1f49843868f1a32b5eb50c112e59009a491d872cfb7290bae79c3'
AND (
token = 'jVjD3pIAAHj8t1R0Kkj/6N3WqUu7MFaiTrk5kjJz1kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)