UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NyU6JR95TRl7vl6jqNtWBCy9zSlCnC7xzRKpnS+Xxis='
WHERE
key_id = 'b8f55813bfdd002cfc6da00d31f047bf93ddd6511038844102363a0b779239ae'
AND (
token = 'NyU6JR95TRl7vl6jqNtWBCy9zSlCnC7xzRKpnS+Xxis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)