UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Xl54Hy1F/bz7dxP3nI0Z+rfNRFIT8PWsjGMN5Q7Rs4='
WHERE
key_id = '126fd6cd6507cf40d7bae960bc754a472ee0fc6fa913c831852e0c4c85bf440c'
AND (
token = '0Xl54Hy1F/bz7dxP3nI0Z+rfNRFIT8PWsjGMN5Q7Rs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)