UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFJQ3NVyR4XBjRv8fxMHk869V21R6bgjmBTDndTLkOc='
WHERE
key_id = 'dfdbd6e802946477b0b026605277f19c5bd6e15bee747c425b8c8d89700dda10'
AND (
token = 'KFJQ3NVyR4XBjRv8fxMHk869V21R6bgjmBTDndTLkOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)